﻿@using wychuan2.com.Extensions
@using wychuan2.com.Models
<nav class="navbar-default navbar-static-side" role="navigation">
    <div class="sidebar-collapse">
        <ul class="nav" id="side-menu">
            <li class="nav-header">
                <div class="dropdown profile-element">
                    <span>
                        <img alt="image" class="img-circle" src="~/img/profile_small.jpg" />
                    </span>
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                        <span class="clear">
                            <span class="block m-t-xs">
                                <strong class="font-bold">@ApplicationUser.Current.UserName</strong>
                            </span> <span class="text-muted text-xs block">码农世界 <b class="caret"></b></span>
                        </span>
                    </a>
                    <ul class="dropdown-menu animated fadeInRight m-t-xs">
                        <li><a href="profile.html">个人信息</a></li>
                        <li><a href="contacts.html">联系方式</a></li>
                        <li><a href="mailbox.html">消息</a></li>
                        <li class="divider"></li>
                        <li><a href="/admin/account/logoff">注销</a></li>
                    </ul>
                </div>
                <div class="logo-element">
                    IN+
                </div>
            </li>
            <li class="@("tools".Equals(Html.Controller(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)">
                <a href=""><i class="fa fa-legal"></i> <span class="nav-label">日常工具</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li class="@("jobs".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/tools/jobs">任务管理</a></li>
                    <li class="@("pinboard".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty) "><a href="/admin/tools/pinboard">记事本</a></li>
                    <li class="@(Html.Action().ToLower().StartsWith("company") ? "active" : string.Empty) "><a href="/admin/tools/company">牛逼公司</a></li>
                    <li class="@("algorithm".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty) "><a href="/admin/tools/algorithm">算法大全</a></li>
                    <li class="@("formbuilder".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty) "><a href="/admin/tools/formbuilder">表单构建器</a></li>
                    <li class="@("wyswig".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty) "><a target="_blank" href="/admin/tools/wyswig">见得编辑器</a></li>
                </ul>
            </li>
            <li class="@("dbtools".Equals(Html.Controller(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)">
                <a href=""><i class="fa fa-database"></i> <span class="nav-label">数据库</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li class="@("tableview".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/dbtools/tableview">表结构查看</a></li>
                    <li class="@("codegenerate".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/dbtools/codegenerate">代码生成</a></li>
                    <li class="@("codetemplate".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/dbtools/codetemplate">代码模板</a></li>
                </ul>
            </li>
            <li class="@("licai".Equals(Html.Controller(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)">
                <a href=""><i class="fa fa-jpy"></i> <span class="nav-label">财务概况</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li class="@("bill".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/bill">记账</a></li>
                    <li class="@("fastbill".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/fastbill">快速记账</a></li>
                    <li class="@("details".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/details">明细</a></li>
                    <li class="@("account".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/account">账户</a></li>
                    <li class="@("account2".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/account2">账户2</a></li>
                    <li class="@("yusuan".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/yusuan">预算</a></li>
                    <li class="@("tongji".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/tongji">统计</a></li>
                    <li class="@("p2p".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/p2p">理财</a></li>
                    <li class="@("setting".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/licai/setting">设置</a></li>
                </ul>
            </li>
            <li class="@("user".Equals(Html.Controller(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)">
                <a href=""><i class="fa fa-cog"></i> <span class="nav-label">个人中心</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li class="@("index".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/user">用户管理</a></li>
                    <li class="@("menu".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/user/menu">菜单管理</a></li>
                    <li class="@("role".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/user/role">角色管理</a></li>
                    <li><a href="">修改密码</a></li>
                </ul>
            </li>
            <li class="">
                <a href=""><i class="fa fa-weixin"></i> <span class="nav-label">微信后台</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li><a href="">菜单管理</a></li>
                    <li><a href="">菜单管理</a></li>
                    <li><a href="">菜单管理</a></li>
                    <li><a href="">菜单管理</a></li>
                </ul>
            </li>
            <li class="@("blog".Equals(Html.Controller(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)">
                <a href=""><i class="fa fa-sitemap"></i> <span class="nav-label">随笔管理</span><span class="fa arrow"></span></a>
                <ul class="nav nav-second-level">
                    <li class="@("index".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/blog">发布随笔</a></li>
                    <li class="@("list".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/blog/list">随笔管理</a></li>
                    <li class="@("setting".Equals(Html.Action(), StringComparison.InvariantCultureIgnoreCase) ? "active" : string.Empty)"><a href="/admin/blog/setting">设置</a></li>
                </ul>
            </li>
        </ul>
    </div>
</nav>

@helper RenderMenuItem(string controllerName, string actionName, string text)
{
    bool isActive = @Html.Controller().Equals(controllerName, StringComparison.InvariantCultureIgnoreCase) &&
                    @Html.Action().Equals(actionName, StringComparison.InvariantCultureIgnoreCase);
    <li class="@(isActive ? "active" : string.Empty)">@Html.ActionLink(text, actionName, controllerName)</li>
}
